<template>
  <div>
    <div class="ele-table-tool ele-table-tool-default">
      <el-button size="mini" type="primary" icon="el-icon-plus" @click="add">添加</el-button>
    </div>
    <el-table
      border
      stripe
      :data="soils"
    >
      <el-table-column
        label="编号"
        width="80"
        align="center"
      >
        <template v-slot="scope">
          {{ scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column
        label="名称"
        prop="name"
        align="center"
      />
      <el-table-column
        label="容重"
        prop="unit_weight"
        align="center"
      />
      <el-table-column
        label="田间持水量"
        prop="field_capacity"
        align="center"
      />
      <el-table-column
        label="凋萎系数"
        prop="wilting_coefficient"
        align="center"
      />
      <el-table-column
        label="饱和含水率"
        prop="water_content"
        align="center"
      />
      <el-table-column
        label="地表径流"
        prop="runoff_curve"
        align="center"
      />
      <el-table-column
        align="center"
        label="操作"
        width="160"
      >
        <template slot-scope="scope">
          <el-link type="primary" icon="el-icon-edit" @click="edit(scope.row)">修改</el-link>
          <el-link type="danger" class="ml12" icon="el-icon-delete" @click="del(scope.row)">删除</el-link>
        </template>
      </el-table-column>
    </el-table>
  </div>

</template>

<script>
export default {
  props: {
    soils: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    add() {
      this.$emit('add')
    },
    edit(row) {
      this.$emit('edit', row)
    },
    del(row) {
      this.$emit('del', row)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
